﻿using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Blazor.SystemModule;

namespace EasyXaf.EntityDesigner.Controllers;

public class DisableExportViewController : ViewController<ListView>
{
    private BlazorExportController _exportController;

    protected override void OnActivated()
    {
        base.OnActivated();

        _exportController = Frame.GetController<BlazorExportController>();
        if (_exportController != null)
        {
            _exportController.Active[Name] = false;
        }
    }

    protected override void OnDeactivated()
    {
        _exportController?.Active.RemoveItem(Name);

        base.OnDeactivated();
    }
}
